using System;
using System.Collections.Generic;
using System.Text;
using Shc.Sql;
using Shc.Json;
namespace Slqj.Data
{
	public static class TableTransferItem
	{
		public const string Table = "TransferItem";
		public const string TransferItemID = "TransferItemID";
		public const string OrdersID = "OrdersID";
		public const string ObjectID = "ObjectID";
		public const string AccountType = "AccountType";
		public const string TotalAmount = "TotalAmount";
		public const string AccountNo = "AccountNo";
		public const string AccountName = "AccountName";
		public const string IsTransferred = "IsTransferred";
		public const string TransferDate = "TransferDate";
		public const string TradeNo = "TradeNo";
		public const string PayInfo = "PayInfo";
		public const string PayStatus = "PayStatus";
	}
	
	[Serializable]
	public class BaseTransferItem
		: IDbSessionEntity, IJsonClass
	{
		int m_TransferItemID;
		/// <summary>
        /// 
        /// </summary>
        public int TransferItemID
        {
            get { return m_TransferItemID; }
            set { m_TransferItemID = value; }
        }
		
		int? m_OrdersID;
		/// <summary>
        /// 
        /// </summary>
        public int? OrdersID
        {
            get { return m_OrdersID; }
            set { m_OrdersID = value; }
        }
		
		int m_ObjectID;
		/// <summary>
        /// 
        /// </summary>
        public int ObjectID
        {
            get { return m_ObjectID; }
            set { m_ObjectID = value; }
        }
		
		int m_AccountType;
		/// <summary>
        /// 
        /// </summary>
        public int AccountType
        {
            get { return m_AccountType; }
            set { m_AccountType = value; }
        }
		
		double m_TotalAmount;
		/// <summary>
        /// 
        /// </summary>
        public double TotalAmount
        {
            get { return m_TotalAmount; }
            set { m_TotalAmount = value; }
        }
		
		string m_AccountNo;
		/// <summary>
        /// 
        /// </summary>
        public string AccountNo
        {
            get { return m_AccountNo; }
            set { m_AccountNo = value; }
        }
		
		string m_AccountName;
		/// <summary>
        /// 
        /// </summary>
        public string AccountName
        {
            get { return m_AccountName; }
            set { m_AccountName = value; }
        }
		
		bool m_IsTransferred;
		/// <summary>
        /// 
        /// </summary>
        public bool IsTransferred
        {
            get { return m_IsTransferred; }
            set { m_IsTransferred = value; }
        }
		
		DateTime? m_TransferDate;
		/// <summary>
        /// 
        /// </summary>
        public DateTime? TransferDate
        {
            get { return m_TransferDate; }
            set { m_TransferDate = value; }
        }
		
		string m_TradeNo;
		/// <summary>
        /// 
        /// </summary>
        public string TradeNo
        {
            get { return m_TradeNo; }
            set { m_TradeNo = value; }
        }
		
		string m_PayInfo;
		/// <summary>
        /// 
        /// </summary>
        public string PayInfo
        {
            get { return m_PayInfo; }
            set { m_PayInfo = value; }
        }
		
		int m_PayStatus;
		/// <summary>
        /// 
        /// </summary>
        public int PayStatus
        {
            get { return m_PayStatus; }
            set { m_PayStatus = value; }
        }
		
		
		#region IDbSessionEntity Members
		public void ReadDBData(RowDataReader reader)
        {
            m_TransferItemID = reader[TableTransferItem.TransferItemID];
            m_OrdersID = reader[TableTransferItem.OrdersID];
            m_ObjectID = reader[TableTransferItem.ObjectID];
            m_AccountType = reader[TableTransferItem.AccountType];
            m_TotalAmount = reader[TableTransferItem.TotalAmount];
            m_AccountNo = reader[TableTransferItem.AccountNo];
            m_AccountName = reader[TableTransferItem.AccountName];
            m_IsTransferred = reader[TableTransferItem.IsTransferred];
            m_TransferDate = reader[TableTransferItem.TransferDate];
            m_TradeNo = reader[TableTransferItem.TradeNo];
            m_PayInfo = reader[TableTransferItem.PayInfo];
            m_PayStatus = reader[TableTransferItem.PayStatus];
        }
		
		public void WriteDBData(RowDataWriter writer)
        {
            writer.SetPrimaryKey(TableTransferItem.TransferItemID, PrimaryKeyType.Identity, TransferItemID);
			writer[TableTransferItem.OrdersID] = OrdersID;
			writer[TableTransferItem.ObjectID] = ObjectID;
			writer[TableTransferItem.AccountType] = AccountType;
			writer[TableTransferItem.TotalAmount] = TotalAmount;
			writer[TableTransferItem.AccountNo] = AccountNo;
			writer[TableTransferItem.AccountName] = AccountName;
			writer[TableTransferItem.IsTransferred] = IsTransferred;
			writer[TableTransferItem.TransferDate] = TransferDate;
			writer[TableTransferItem.TradeNo] = TradeNo;
			writer[TableTransferItem.PayInfo] = PayInfo;
			writer[TableTransferItem.PayStatus] = PayStatus;
        }

        public void SetIdentityAfterInsert(DBObject idd)
        {
            m_TransferItemID = idd;
        }
		
		public string TableName
        {
            get { return TableTransferItem.Table; }
        }
		#endregion
		
		#region IJsonClass Members

        public void JsonDeSerializeObj(JsonHashTable hashToRead)
        {
             m_TransferItemID = hashToRead["TransferItemID"];
			 
             m_OrdersID = hashToRead["OrdersID"];
			 
             m_ObjectID = hashToRead["ObjectID"];
			 
             m_AccountType = hashToRead["AccountType"];
			 
             m_TotalAmount = hashToRead["TotalAmount"];
			 
             m_AccountNo = hashToRead["AccountNo"];
			 
             m_AccountName = hashToRead["AccountName"];
			 
             m_IsTransferred = hashToRead["IsTransferred"];
			 
             m_TransferDate = hashToRead["TransferDate"];
			 
             m_TradeNo = hashToRead["TradeNo"];
			 
             m_PayInfo = hashToRead["PayInfo"];
			 
             m_PayStatus = hashToRead["PayStatus"];
			 
        }

        public void JsonSerializeObj(JsonHashTable hashToFill)
        {
            hashToFill["TransferItemID"] = TransferItemID;
			 
            hashToFill["OrdersID"] = OrdersID;
			 
            hashToFill["ObjectID"] = ObjectID;
			 
            hashToFill["AccountType"] = AccountType;
			 
            hashToFill["TotalAmount"] = TotalAmount;
			 
            hashToFill["AccountNo"] = AccountNo;
			 
            hashToFill["AccountName"] = AccountName;
			 
            hashToFill["IsTransferred"] = IsTransferred;
			 
            hashToFill["TransferDate"] = TransferDate;
			 
            hashToFill["TradeNo"] = TradeNo;
			 
            hashToFill["PayInfo"] = PayInfo;
			 
            hashToFill["PayStatus"] = PayStatus;
			 
        }

        #endregion
		
	}
}
